﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>SiteServer 管理后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <link href="../assets/images/favicon.png" rel="icon" type="image/png" />
    <link
      href="../assets/css/font-awesome-4.7.0.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../assets/css/bootstrap.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <link
      href="../assets/css/siteserver.min.css"
      rel="stylesheet"
      type="text/css"
    />
    <style>
      .nav .nav-link {
        font-weight: normal;
        border-radius: 1.25rem;
        font-size: 14px;
      }
    </style>
  </head>

  <body>
    <div id="main" class="m-t-15 m-b-15 m-l-15 m-r-15">
      <template v-if="pageLoad">
        <div class="card-box" style="padding: 10px; margin-bottom: 10px">
          <ul class="nav nav-pills nav-justified">
            <li class="nav-item">
              <a
                class="nav-link"
                href="javascript:;"
                @click="{btnNavClick('logs.html')}"
              >
                数据列表
              </a>
            </li>
            <li class="nav-item">
              <a
                class="nav-link active"
                href="javascript:;"
                @click="{btnNavClick('fields.html')}"
              >
                字段管理
              </a>
            </li>
            <li class="nav-item">
              <a
                class="nav-link"
                href="javascript:;"
                @click="{btnNavClick('settings.html')}"
              >
                选项设置
              </a>
            </li>
            <li class="nav-item" v-if="config.returnUrl">
              <a class="nav-link" :href="config.returnUrl">返回列表</a>
            </li>
          </ul>
        </div>
        <div class="card-box">
          <div
            v-if="pageAlert"
            class="alert"
            v-bind:class="{ 'alert-warning': pageAlert.type === 'warning', 'alert-success': pageAlert.type === 'success', 'alert-danger': pageAlert.type === 'danger' }"
          >
            <button
              v-on:click="pageAlert = null"
              class="close"
              data-dismiss="alert"
            >
              ×
            </button>
            <span v-html="pageAlert.html"></span>
          </div>
          <div class="table-responsive">
            <table class="table tablesaw table-hover m-0">
              <thead>
                <tr>
                  <th class="text-center">排序</th>
                  <th>字段名称</th>
                  <th class="text-center">提交类型</th>
                  <th class="text-center">验证规则</th>
                  <th class="text-center">操作</th>
                </tr>
              </thead>
              <tbody>
                <tr v-for="item in items">
                  <td class="text-center">{{ item.taxis }}</td>
                  <td>{{ item.title }}</td>
                  <td class="text-center">{{ item.inputType }}</td>
                  <td class="text-center">
                    <a
                      href="javascript:;"
                      v-on:click="btnValidateClick(item.id)"
                    >
                      {{ item.validate || "无验证" }}
                    </a>
                  </td>
                  <td class="text-center">
                    <a href="javascript:;" v-on:click="btnEditClick(item.id)">
                      编辑
                    </a>
                    <a
                      v-if="!item.isSystem"
                      class="text-danger ml-2"
                      href="javascript:;"
                      v-on:click="btnDeleteClick(item.title, item.id)"
                    >
                      删除
                    </a>
                  </td>
                </tr>
              </tbody>
            </table>
          </div>
          <hr />

          <a
            href="javascript:;"
            v-on:click="btnAddClick"
            class="btn btn-sm btn-outline-primary pl-3 pr-3"
          >
            <i class="fa fa-plus"></i> 新增字段
          </a>
          <file-upload
            class="btn btn-sm btn-outline-primary pl-3 pr-3"
            :post-action="uploadUrl"
            extensions="zip"
            :multiple="false"
            v-model="files"
            v-on:input-file="inputFile"
            @input-filter="inputFilter"
            ref="import"
          >
            <i class="fa fa-upload"></i> 导入字段
          </file-upload>
          <a
            href="javascript:;"
            v-on:click="btnExportClick"
            class="btn btn-sm btn-outline-primary pl-3 pr-3"
          >
            <i class="fa fa-download"></i> 导出字段
          </a>
        </div>
      </template>
      <template v-else>
        <div class="text-center" style="margin-top: 100px">
          <img class="mt-3" src="../assets/images/loading.gif" />
          <p class="lead mt-3 text-nowrap">载入中，请稍后...</p>
        </div>
      </template>
    </div>
  </body>
</html>
<script src="../assets/lib/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../assets/lib/lodash-4.17.10.min.js"></script>
<script src="../assets/lib/layer-3.1.1/layer.js"></script>
<script src="../assets/lib/sweetalert2-7.28.4.all.min.js"></script>
<script src="../assets/lib/vue-2.5.16.min.js" type="text/javascript"></script>
<script src="../assets/lib/vee-validate-2.1.0.js"></script>
<script src="../assets/lib/vee-validate-locale-zh_CN-2.1.0.js"></script>
<script src="../assets/lib/js.cookie-2.2.0.js"></script>
<script src="../assets/lib/es6-promise.auto.min.js"></script>
<script src="../assets/lib/axios-0.18.0.min.js"></script>
<script src="../assets/lib/vue-upload-component-2.8.14.js"></script>
<script src="../assets/js/utils.js" type="text/javascript"></script>
<script src="fields.js" type="text/javascript"></script>
